package br.com.unb.provenance.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import br.com.unb.provenance.domain.Attribute;
import br.com.unb.provenance.domain.TypeRelationship;

@Entity
@Table(name = "Relation")
public class Relation extends Provenance {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id")
	private Integer id;
	
	@OneToOne
	@JoinColumn(name = "source")
	private Activity source; 
	
	@OneToOne
	@JoinColumn(name = "destination")
	private Activity destination;
	
	@Column(name = "type")
	@Enumerated(EnumType.ORDINAL)
	private TypeRelationship type;
	
	@Column(name = "attribute")
	@Enumerated(EnumType.STRING)
	private Attribute attribute; 
	
	@Column(name = "annotation")
	private String annotation;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Activity getSource() {
		return source;
	}

	public void setSource(Activity source) {
		this.source = source;
	}

	public Activity getDestination() {
		return destination;
	}

	public void setDestination(Activity destination) {
		this.destination = destination;
	}

	public TypeRelationship getType() {
		return type;
	}

	public void setType(TypeRelationship type) {
		this.type = type;
	}

	public Attribute getAttribute() {
		return attribute;
	}

	public void setAttribute(Attribute attribute) {
		this.attribute = attribute;
	}

	public String getAnnotation() {
		return annotation;
	}

	public void setAnnotation(String annotation) {
		this.annotation = annotation;
	}
	
	
}
